public class Participant {
    private final PrizePool prizePool;
    private final String name;
    private Prize prizeWon;

    public Participant(String name, PrizePool prizePool) {
        this.name = name;
        this.prizePool = prizePool;
    }

    public void run() {
        try {
            // 模拟网络延迟或用户思考时间
            Thread.sleep((long) (Math.random() * 2000));

            prizeWon = prizePool.drawPrize(name);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }

    public Prize getPrizeWon() {
        return prizeWon;
    }

    public String getParticipantName() {
        return name;
    }
}